home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6309 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: news.ov.com!news
  2. From: glenn@ov.com (Fletcher.Glenn@ov.com)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Help Me !
  5. Date: 23 Feb 1996 21:41:44 GMT
  6. Organization: OpenVision
  7. Message-ID: <4glcao$lml@spanky.pls.ov.com>
  8. References: <4geh23$e3u@newsbf02.news.aol.com>
  9. Reply-To: glenn@ov.com
  10. NNTP-Posting-Host: foghorn.pls.ov.com
  11.  
  12. In article e3u@newsbf02.news.aol.com, mackboring@aol.com (MackBoring) writes:
  13. >I need to create a program to display a list of the first 1000 prime
  14. >integers (starting with 2) you need test only odd numbers and for
  15. >divisibilty with odd numbers
  16.  
  17.  
  18. Your obvious homework problem caught my attention.  Using the principles 
  19. from my previous post, I wrote a program to calculate n primes where 
  20. n is supplied as an argument to the program.  This took about 1/2 hour.
  21. It took 14.1 seconds to calculate and print 10,000 primes.  If 2 is the
  22. first prime, then the 10,000th is 104,729.  The largest prime I had to
  23. divide by in order to prove this prime was 317.
  24.  
  25.             Fletcher.Glenn@ov.com
  26.  
  27. PS - the 1000th prime is 7919.  This took 0.9 seconds to calculate and print
  28. all 1000 numbers.
  29.  
  30.  
  31.